﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace XChip_Tool_BinApp
{
    public class USBDeviceModel : INotifyPropertyChanged
    {
        private string _deviceName;
        public string DeviceName
        {
            get { return _deviceName; }
            set
            {
                if (_deviceName != value)
                {
                    _deviceName = value;
                    OnPropertyChanged(nameof(DeviceName));
                }
            }
        }

        private string _pid;
        public string PID
        {
            get { return _pid; }
            set
            {
                if (_pid != value)
                {
                    _pid = value;
                    OnPropertyChanged(nameof(PID));
                }
            }
        }

        private string _vid;
        public string VID
        {
            get { return _vid; }
            set
            {
                if (_vid != value)
                {
                    _vid = value;
                    OnPropertyChanged(nameof(VID));
                }
            }
        }

        private string _devicePath;
        public string DevicePath
        {
            get { return _devicePath; }
            set
            {
                if (_devicePath != value)
                {
                    _devicePath = value;
                    OnPropertyChanged(nameof(DevicePath));
                }
            }
        }

        private int _index;
        public int Index
        {
            get { return _index; }
            set
            {
                if (_index != value)
                {
                    _index = value;
                    OnPropertyChanged(nameof(Index));
                }
            }
        }
        private int _deviceNum;
        public int DeviceNum
        {
            get { return _deviceNum; }
            set
            {
                if (_deviceNum != value)
                {
                    _deviceNum = value;
                    OnPropertyChanged(nameof(DeviceNum));
                }
            }
        }
        private bool _isOpen;
        public bool IsOpen
        {
            get { return _isOpen; }
            set
            {
                if (_isOpen != value)
                {
                    _isOpen = value;
                    OnPropertyChanged(nameof(IsOpen));
                }
            }
        }

        public string FwName
        {
            get { return _fwname; }
            set
            {
                if (_fwname != value)
                {
                    _fwname = value;
                    OnPropertyChanged(nameof(FwName));
                }
            }
        }

        private string _fwname;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }

  

}
